package com.ficus.road.maintain.handler.smartdecision.handlers.highway;

import com.ficus.road.maintain.core.model.smartnew.SmartDecisionHighwayRequest;
import com.ficus.road.maintain.core.model.smartnew.SmartDecisionRequest;
import com.ficus.road.maintain.core.model.smartnew.SmartDecisionResponse;
import com.ficus.road.maintain.handler.smartdecision.enums.SmartDecisionStrategyEnum;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author xiawen yang
 * @date 2022/7/20 下午4:02
 */
@Component
@Order(1)
public class SmartDecisionHighwayInspectionHandler extends AbstractSmartDecisionHighwayHandler {

    private static final SmartDecisionStrategyEnum STRATEGY = SmartDecisionStrategyEnum.HIGHWAY_INSPECTION;

    @Override
    public SmartDecisionResponse doHandle(SmartDecisionRequest request, SmartDecisionResponse response) {
        SmartDecisionHighwayRequest highwayRequest = (SmartDecisionHighwayRequest) request;
        return strategySmartDecisionService.smartDecisionCalculate(STRATEGY, highwayRequest.getParams(), response);
    }
}
